<?php if (!defined('BASEPATH'))exit('No direct script access allowed');

class Berita_akademik extends CI_Controller
{
    public function index()
    {
        $data['rslt_berita'] = $this->db->query('SELECT * FROM berita ORDER BY tanggal DESC');
        $this->template->home('home/v_berita_akademik', $data, "Berita Akademik");
    }
	
	public function isi_berita($id_berita = null)
	{
		if($id_berita == null) show_404();
		else
		{
			$rslt_berita = $this->db->from('berita')->where('id', $id_berita)->limit(1)->get();
			if($rslt_berita->num_rows() > 0)
			{
				$rslt_berita = $rslt_berita->row();
				$data['isi_berita'] = $rslt_berita->berita_isi;
				$data['judul_berita'] = $rslt_berita->judul;
				$data['gambar'] = $rslt_berita->gambar;
				
				$this->template->home('home/v_berita_akademik_baca', $data, $rslt_berita->judul." - Berita Akademik");
			}
			else show_404();
		}
	}
}

/* End of file berita_akademik.php */
/* Location: ./application/controllers/berita_akademik.php */